{{define "Title"}}第三方包{{end}}
{{define "ContentWidth"}}8{{end}}
{{define "Breadcrumb"}}
<ul class="breadcrumb">
  <li><a href="/"><i class="glyphicon glyphicon-home"></i> 首页</a></li>
  <li class="active">第三方包</li>
</ul>
{{end}}
{{define "Content"}}
<div class="content">
  <h1>Go语言第三方包</h1>
  <div class="alert alert-info">
	该板块列举Go语言的第三方包，如果你发现了比较好的库，请提交上来，如果是你写的库，那么更需要列举上来。
  </div>
  <h2>最新提交</h2>
  <dl class="topics">
	{{$username := .username}}
	{{range .latestPackages}}
    {{$category := .Category $.db}}
	{{$creater := .Creater $.db}}
	<dd>
	  <a href="/p/{{.Id_.Hex}}" class="title">{{.Title}}</a>
	  {{if $username}}
	  {{if .CanEdit $username $.db}}
	  <a href="/p/{{.Id_.Hex}}/edit"><i class="icon-pencil"></i></a>
	  <a href="/p/{{.Id_.Hex}}/delete" onclick="javascript:return confirm('确定要删除吗？');"><i class="icon-remove"></i></a>
	  {{end}}
	  {{end}}
	  <div class="space"></div>
	  <div class="info">
		<a class="label label-info" href="/packages/{{$category.Id}}">{{$category.Name}}</a> •
		<a href="/member/{{$creater.Username}}"><strong>{{$creater.Username}}</strong></a> •
		{{formattime .CreatedAt}} 提交
	  </div>
	  <div class="space"></div>
	  <p class="muted">
		{{$.utils.Truncate .Html 200}}
	  </p>
	  <div class="clear"></div>
	</dd>
	{{end}}
  </dl>
</div>
{{end}}

{{define "LeftSide"}}
{{end}}

{{define "RightSide"}}
<div class="col-md-4 sidebar">
  <a href="/package/new" class="btn btn-primary btn-lg btn-block" style="margin-bottom: 20px;">提交第三方包</a>

  <div class="panel panel-default">
	<div class="panel-heading">
	  <h3 class="panel-title">分类</h3>
	</div>
	<ul class="list-group">
	  {{range .categories}}
	  <li class="list-group-item"><a href="/packages/{{.Id}}">{{.Name}}<span class="badge pull-right">{{.PackageCount}}</span></a></li>
	  {{end}}
	</ul>
  </div>
</div>
{{end}}
